<?php
/*
* $Id: backend.php 2942 2009-11-30 10:48:18Z huong.pham $
* Backend controler
* @author : Huong Pham
*/
class Backend extends TV_Controller
{
    protected $template = 'backend';
    protected $authUrl = 'admin/login';

    function Backend (){
        
        parent::__Construct();
        require_once(APPPATH . '/libraries/app_constants.php');
        if(ENV_NAME == 'local')
        {
            $this->output->enable_profiler(TRUE);
        } 
        //Default keyword search;
        $this->data['keyword'] = '';
        
        // Default css, js
        $this->layout[AppContants::LAYOUT_CSS] = array();
        $this->layout[AppContants::LAYOUT_JS] = array(); 
        $this->layout[AppContants::BREADCRUMB] = array();
        $this->layout[AppContants::LAYOUT_TOP] = "admin/navigation";
        $this->layout[AppContants::LAYOUT_BOTTOM] = "footer";
        $this->data[AppContants::ACTIVE_MENU] = "";
        
        // Default meta header info
        $this->meta = array();
        $this->meta[AppContants::META_TITLE] = '';
        $this->meta[AppContants::META_KEYWORDS] = '';
        $this->meta[AppContants::META_DESCRIPTION] = '';
        
    }
    
    function showMessage($msg, $url, $autoRedirect = true)
    {
        $this->data['message'] = $msg;
        $this->data['url'] = $url;
        $this->data['auto'] = $autoRedirect;
        $this->layout[AppContants::LAYOUT_CSS] = array('common');
        $this->layout[AppContants::LAYOUT_MAINVIEW] = 'message';
    }
}
?>
